package com.wnxy.pms.order.core.controller;


import com.wnxy.pms.common.api.Result;
import com.wnxy.pms.order.core.service.IOrderItemService;
import com.wnxy.pms.order.core.vo.OrderItemVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 订单中所包含的商品 前端控制器
 * </p>
 *
 * @author Jet
 * @since 2022-06-09
 */
@RestController
@RequestMapping("/auth/order-item")
@Api(tags = "订单明细项接口")
public class OrderItemController {

    @Autowired
    private IOrderItemService itemService;

    @GetMapping("/{orderSn}")
    public Result<List<OrderItemVo>> list(@PathVariable("orderSn") String orderSn){
        List<OrderItemVo> orderItemVos = itemService.findByOrderSn(orderSn);
        return Result.ok(orderItemVos);
    }
}
